package com.maxuxu.scihome.config;

import com.maxuxu.scihome.interceptor.LoginInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @className: AdminWebConfig
 * @author: Maxuxu
 * @date: 2022/7/6 0:15
 * @description:
 */

// @Configuration
public class AdminWebConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new LoginInterceptor())
                //拦截所有请求,包括静态资源，所有下面要放行
                .addPathPatterns("/**")
                //放行拦截的请求
                .excludePathPatterns("/","/user/ajaxlogin","/tologin","/css/**","/images/**","/js/**","/images/**",
                        "/json/**","/login/**");

    }
}